
chains = {2:2}
def getChainLen(num):
    if chains.has_key( num ):
        return chains[num]
    else:
        if num % 2 == 0:
            new = num / 2
        else:
            new = 3 * num + 1
        cl = getChainLen(new) + 1
        chains[num] = cl
        return cl
    
def main():
    limit = 10**6
    maxChainLen = 2 
    for i in range(3, limit):
        cl = getChainLen(i)
        # print cl,
        maxChainLen = max(cl, maxChainLen)
    print maxChainLen
    print len(chains)
main()
